package com.example.alibabaconsumeropenfeign9000.service.impl;

import com.example.alibabacloudcommonsresult.entity.JsonResult;
import com.example.alibabaconsumeropenfeign9000.service.FeignService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class FeignServiceImpl implements FallbackFactory<FeignService> {
  @Override
  public FeignService create(Throwable cause) {
    return new FeignService() {
      @Override
      public JsonResult<String> getInfo(Long id) {
        
        return new JsonResult<>(200, "执行了降级处理");
      }
    };
  }
}
